package me.lovatcat.springboot.demo.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import me.lovetcat.common.validate.annotation.In;
import me.lovetcat.common.validate.annotation.Mobile;
import org.hibernate.validator.constraints.NotEmpty;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Size;
import java.util.Date;

/**
 * @author acat on 2017-01-13 14:22
 */
@ApiModel(value = "用户")
public class UserAddVo {

    @ApiModelProperty(value = "姓名", dataType = "String", required = true, example = "张三")
    @NotEmpty(message = "{user.name.NotEmpty}")
    @Size(min = 2, max = 20, message = "{user.name.Size}")
    private String name;
    @ApiModelProperty(value = "登陆密码", dataType = "String", required = true, example = "123456")
    @NotEmpty(message = "{user.password.NotEmpty}")
    @Size(min = 6, max = 18, message = "{user.password.Size}")
    private String password;
    @ApiModelProperty(value = "年龄", dataType = "int", example = "25")
    @Range(min = 0, max = 150, message = "{user.age.Range}")
    private String age;
    @ApiModelProperty(value = "性别", dataType = "String", allowableValues = "1,2", notes = "1=男，2=女", example = "1")
    @In(vals = {"1", "2"}, message = "{user.sex.In}")
    private String sex;
    @ApiModelProperty(value = "手机号码", dataType = "String", required = true, example = "15068874442")
    @Mobile
    private String mobile;
    @ApiModelProperty(value = "生日", dataType = "Date", example = "2017-02-15")
    private Date birthday;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    @Override
    public String toString() {
        return "UserAddVo{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", age=" + age +
                ", sex='" + sex + '\'' +
                ", mobile='" + mobile + '\'' +
                ", birthday=" + birthday +
                '}';
    }
}
